<?php

    $key =$_COOKIE['userkey'];
$userName='';
$state=false;
session_start();
    if (!isset($_SESSION[$key]['username'])){
        $userName= "你尚未登入，<a href='../login.php'>请登入</a>";

    }else{
        $userName= "欢迎你  ".$_SESSION[$key]["realname"];
        $state=true;
    }
$imgout =$_GET['log'];
?>

<html>
<body>
<p><?php echo $userName?></p>
<?php if ($state){?>
<a href="logout.php">退出登录</a>
<a href="ChangePassword.php"><button>修改密码</button></a>
<br />
你的头像：<img src="<?php echo $imgout?>">
<form method="post" action="image.php" enctype="multipart/form-data">
 <input type="file" name="file">
<input type="submit" value="上传头像">
</form>
<?php }?>
</body>
</html>
